package top.canyue.word_range.pojo.po;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import top.canyue.word_range.pojo.vo.WordMappingVo;

import java.util.Date;

/**
 * 解释
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WordMapping {
    /**
     * 雪花ID
     */
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;
    /**
     * 单词
     */
    private String word;
    /**
     * 词书ID
     */
    private String bookId;
    /**
     * 翻译
     */
    private String tran;
    /**
     * 例句
     */
    private String example;
    /**
     * 例句翻译
     */
    private String exampleTran;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 最近一次更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    public WordMappingVo toVo() {
        return new WordMappingVo(id, word, bookId, tran, example, exampleTran, createTime, updateTime);
    }

}
